﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Aliyeye.Car.Net.UI.Controls
{
    public partial class Line : UserControl
    {
        private Pen _pen = null;
        private Color _color = Color.Empty;

        public Line()
        {
            this.SetStyle(ControlStyles.SupportsTransparentBackColor |
                ControlStyles.DoubleBuffer | ControlStyles.UserPaint |
                ControlStyles.AllPaintingInWmPaint, true);
            this.UpdateStyles();

            this.Color = Color.Blue;

            InitializeComponent();
        }

        public Color Color
        {
            get
            {
                return this._color;
            }
            set
            {
                this._pen = new Pen(value);
                this._color = value;
            }
        }

        protected override void OnPaint(PaintEventArgs pe)
        {
            Graphics g = pe.Graphics;
            g.DrawLine(this._pen, 0, 3, this.Location.X + this.Size.Width, 3);
            base.OnPaint(pe);
        }

        private void Line_Load(object sender, EventArgs e)
        {

        }
    }
}
